# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dtp-spoof
pkgver=5.3ae05fc
pkgrel=3
pkgdesc='Python script/security tool to test Dynamic Trunking Protocol configuration on a switch.'
groups=('blackarch' 'blackarch-networking')
arch=('any')
url='https://github.com/fleetcaptain/dtp-spoof'
license=('custom:unknown')
depends=('python2' 'python2-scapy')
makedepends=('git')
source=("git+https://github.com/fleetcaptain/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i\#!/usr/bin/python2' "py/network/$pkgname.py"
}

package() {
  cd $pkgname

  install -Dm 755 "py/network/$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

